/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package action.Management;

import Database.ProfileDAO;
import Models.Profile;
import static com.opensymphony.xwork2.Action.SUCCESS;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

/**
 *
 * @author trang_000
 */
public class ProcessProfileAction extends ActionSupport{
    private int profileID;
    private Profile profile;
    private ProfileDAO profileDAO = new ProfileDAO();

    public int getProfileID() {
        return profileID;
    }

    public void setProfileID(int profileID) {
        this.profileID = profileID;
    }

    public Profile getProfile() {
        return profile;
    }

    public void setProfile(Profile profile) {
        this.profile = profile;
    }
    
    
    @Override
    @Action(value = "Profile-Process/*", results = {
        @Result(name = "success", location = "/Profile/ProcessProfilePage.jsp")},
            params = {"profileID", "{1}"})
    public String execute() throws Exception {
        profile = profileDAO.getProfileByProfileID(profileID);
        
        return SUCCESS;
    }    
}
